<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取vue对象中不同类型的数据</title>
</head>
<body>
    <div id="app">
<!--
        v-model:(双向)
        取值:从vue的data获取数据展示页面
        赋值:从页面获取数据赋值到data
-->
<input type="text" v-model="msg" @blur="fun1"/>

</div>

</body>
<script src="js/vue.js"></script>
<script>
    new Vue({
        el:'#app',
        data:{
            msg:'hello world',
            person:{
                id:1,
                username:'diaochan',
                sex:'women'
            },
            arr:["a","b","c"],
            personList:[
                {
                    id: 1,
                    username: 'diaochan',
                    sex: 'women'
                },
                {
                    id: 2,
                    username: 'zhuge',
                    sex: 'man'
                },
                {
                    id: 3,
                    username: 'zhangfei',
                    sex: 'man'
                }
            ]
        },
        methods:{
            fun1() {
                //this指代的是当前的vue对象
                alert(this.msg)
            }
        }
    })

</script>
</html>